package com.baimo.support.controller;

import com.baimo.support.bean.BaseBean;
import com.baimo.support.commons.constants.Constants;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping("/admin")
public class AdminController extends BaseController{
    @RequestMapping(value = "/login", method = RequestMethod.POST)
    public BaseBean admin(HttpServletRequest request, HttpServletResponse response) {
        try {
            return iAdminService.login(request,response);
        } catch (Exception e) {
            e.printStackTrace();
            return new BaseBean(Constants.Global.Code.SYSTEM_FAIL_EXIT);
        }
    }
}
